function _instanceof(A, B) {
    A = A.__proto__
    B = B.prototype

    while (true) {
        if (A === null) {
            return false
        }
        if (A === B) {
			return true;
		}
		A = A.__proto__;
    }
}

class Person{}

let p = new Person()

console.log(_instanceof(p, Person))

